package org.jivesoftware.smackx.filetransfer;

import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.XMPPError;

public class OutgoingFileTransfer extends FileTransfer
{
  private static int RESPONSE_TIMEOUT = 60000;
  private NegotiationProgress callback;
  private String initiator;
  private OutputStream outputStream;
  private Thread transferThread;

  protected OutgoingFileTransfer(String paramString1, String paramString2, String paramString3, FileTransferNegotiator paramFileTransferNegotiator)
  {
    super(paramString2, paramString3, paramFileTransferNegotiator);
    this.initiator = paramString1;
  }

  private void checkTransferThread()
  {
    if (((this.transferThread != null) && (this.transferThread.isAlive())) || (isDone()))
      throw new IllegalStateException("File transfer in progress or has already completed.");
  }

  public static int getResponseTimeout()
  {
    return RESPONSE_TIMEOUT;
  }

  private void handleXMPPException(XMPPException paramXMPPException)
  {
    XMPPError localXMPPError = paramXMPPException.getXMPPError();
    if (localXMPPError != null)
    {
      int i = localXMPPError.getCode();
      if (i == 403)
      {
        setStatus(FileTransfer.Status.refused);
        return;
      }
      if (i != 400)
        break label58;
      setStatus(FileTransfer.Status.error);
      setError(FileTransfer.Error.not_acceptable);
    }
    while (true)
    {
      while (true)
        setException(paramXMPPException);
      label58: setStatus(FileTransfer.Status.error);
    }
  }

  private OutputStream negotiateStream(String paramString1, long paramLong, String paramString2)
    throws XMPPException
  {
    OutputStream localOutputStream;
    if (!(updateStatus(FileTransfer.Status.initial, FileTransfer.Status.negotiating_transfer)))
      throw new XMPPException("Illegal state change");
    StreamNegotiator localStreamNegotiator = this.negotiator.negotiateOutgoingTransfer(getPeer(), this.streamID, paramString1, paramLong, paramString2, RESPONSE_TIMEOUT);
    if (localStreamNegotiator == null)
    {
      setStatus(FileTransfer.Status.error);
      setError(FileTransfer.Error.no_response);
      localOutputStream = null;
    }
    while (true)
    {
      return localOutputStream;
      if (!(updateStatus(FileTransfer.Status.negotiating_transfer, FileTransfer.Status.negotiating_stream)))
        throw new XMPPException("Illegal state change");
      this.outputStream = localStreamNegotiator.createOutgoingStream(this.streamID, this.initiator, getPeer());
      if (!(updateStatus(FileTransfer.Status.negotiating_stream, FileTransfer.Status.negotiated)))
        throw new XMPPException("Illegal state change");
      localOutputStream = this.outputStream;
    }
  }

  public static void setResponseTimeout(int paramInt)
  {
    RESPONSE_TIMEOUT = paramInt;
  }

  public void cancel()
  {
    setStatus(FileTransfer.Status.cancelled);
  }

  public long getBytesSent()
  {
    return this.amountWritten;
  }

  protected OutputStream getOutputStream()
  {
    OutputStream localOutputStream;
    if (getStatus().equals(FileTransfer.Status.negotiated))
      localOutputStream = this.outputStream;
    while (true)
    {
      return localOutputStream;
      localOutputStream = null;
    }
  }

  /**
   * @deprecated
   */
  public OutputStream sendFile(String paramString1, long paramLong, String paramString2)
    throws XMPPException
  {
    monitorenter;
    try
    {
      throw new IllegalStateException("The negotation process has already been attempted on this file transfer");
    }
    finally
    {
      monitorexit;
      throw localObject;
      try
      {
        this.outputStream = negotiateStream(paramString1, paramLong, paramString2);
        OutputStream localOutputStream = this.outputStream;
        monitorexit;
        return localOutputStream;
      }
      catch (XMPPException localXMPPException)
      {
        handleXMPPException(localXMPPException);
        throw localXMPPException;
      }
    }
  }

  /**
   * @deprecated
   */
  public void sendFile(File paramFile, String paramString)
    throws XMPPException
  {
    monitorenter;
    try
    {
      throw new IllegalArgumentException("Could not read file");
    }
    finally
    {
      monitorexit;
      throw localObject;
      setFileInfo(paramFile.getAbsolutePath(), paramFile.getName(), paramFile.length());
      this.transferThread = new Thread(new Runnable(this, paramFile, paramString)
      {
        // ERROR //
        public void run()
        {
          // Byte code:
          //   0: aload_0
          //   1: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   4: aload_0
          //   5: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   8: aload_0
          //   9: getfield 23	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:val$file	Ljava/io/File;
          //   12: invokevirtual 41	java/io/File:getName	()Ljava/lang/String;
          //   15: aload_0
          //   16: getfield 23	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:val$file	Ljava/io/File;
          //   19: invokevirtual 45	java/io/File:length	()J
          //   22: aload_0
          //   23: getfield 25	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:val$description	Ljava/lang/String;
          //   26: invokestatic 49	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$0	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;Ljava/lang/String;JLjava/lang/String;)Ljava/io/OutputStream;
          //   29: invokestatic 53	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$1	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;Ljava/io/OutputStream;)V
          //   32: aload_0
          //   33: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   36: invokestatic 57	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   39: ifnonnull +16 -> 55
          //   42: return
          //   43: astore_1
          //   44: aload_0
          //   45: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   48: aload_1
          //   49: invokestatic 61	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$3	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;Lorg/jivesoftware/smack/XMPPException;)V
          //   52: goto -10 -> 42
          //   55: aload_0
          //   56: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   59: getstatic 67	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:negotiated	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   62: getstatic 70	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:in_progress	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   65: invokevirtual 74	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:updateStatus	(Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;)Z
          //   68: ifeq -26 -> 42
          //   71: aconst_null
          //   72: astore_2
          //   73: new 76	java/io/FileInputStream
          //   76: dup
          //   77: aload_0
          //   78: getfield 23	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:val$file	Ljava/io/File;
          //   81: invokespecial 79	java/io/FileInputStream:<init>	(Ljava/io/File;)V
          //   84: astore_3
          //   85: aload_0
          //   86: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   89: aload_3
          //   90: aload_0
          //   91: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   94: invokestatic 57	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   97: invokevirtual 83	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:writeToStream	(Ljava/io/InputStream;Ljava/io/OutputStream;)V
          //   100: aload_3
          //   101: ifnull +7 -> 108
          //   104: aload_3
          //   105: invokevirtual 88	java/io/InputStream:close	()V
          //   108: aload_0
          //   109: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   112: invokestatic 57	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   115: invokevirtual 93	java/io/OutputStream:flush	()V
          //   118: aload_0
          //   119: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   122: invokestatic 57	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   125: invokevirtual 94	java/io/OutputStream:close	()V
          //   128: aload_0
          //   129: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   132: getstatic 70	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:in_progress	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   135: getstatic 97	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:complete	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   138: invokevirtual 74	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:updateStatus	(Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;)Z
          //   141: pop
          //   142: goto -100 -> 42
          //   145: astore 15
          //   147: aload 15
          //   149: astore 5
          //   151: aload_0
          //   152: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   155: getstatic 100	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:error	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   158: invokevirtual 104	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:setStatus	(Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;)V
          //   161: aload_0
          //   162: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   165: getstatic 110	org/jivesoftware/smackx/filetransfer/FileTransfer$Error:bad_file	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Error;
          //   168: invokevirtual 114	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:setError	(Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Error;)V
          //   171: aload_0
          //   172: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   175: aload 5
          //   177: invokevirtual 118	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:setException	(Ljava/lang/Exception;)V
          //   180: aload_2
          //   181: ifnull +7 -> 188
          //   184: aload_2
          //   185: invokevirtual 88	java/io/InputStream:close	()V
          //   188: aload_0
          //   189: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   192: invokestatic 57	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   195: invokevirtual 93	java/io/OutputStream:flush	()V
          //   198: aload_0
          //   199: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   202: invokestatic 57	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   205: invokevirtual 94	java/io/OutputStream:close	()V
          //   208: goto -80 -> 128
          //   211: astore 8
          //   213: goto -85 -> 128
          //   216: astore 14
          //   218: aload 14
          //   220: astore 11
          //   222: aload_0
          //   223: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   226: getstatic 100	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:error	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   229: invokevirtual 104	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:setStatus	(Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;)V
          //   232: aload_0
          //   233: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   236: aload 11
          //   238: invokevirtual 118	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:setException	(Ljava/lang/Exception;)V
          //   241: aload_2
          //   242: ifnull +7 -> 249
          //   245: aload_2
          //   246: invokevirtual 88	java/io/InputStream:close	()V
          //   249: aload_0
          //   250: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   253: invokestatic 57	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   256: invokevirtual 93	java/io/OutputStream:flush	()V
          //   259: aload_0
          //   260: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   263: invokestatic 57	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   266: invokevirtual 94	java/io/OutputStream:close	()V
          //   269: goto -141 -> 128
          //   272: astore 12
          //   274: goto -146 -> 128
          //   277: astore 6
          //   279: aload_2
          //   280: ifnull +7 -> 287
          //   283: aload_2
          //   284: invokevirtual 88	java/io/InputStream:close	()V
          //   287: aload_0
          //   288: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   291: invokestatic 57	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   294: invokevirtual 93	java/io/OutputStream:flush	()V
          //   297: aload_0
          //   298: getfield 21	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$2:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   301: invokestatic 57	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   304: invokevirtual 94	java/io/OutputStream:close	()V
          //   307: aload 6
          //   309: athrow
          //   310: astore 13
          //   312: goto -184 -> 128
          //   315: astore 7
          //   317: goto -10 -> 307
          //   320: astore 6
          //   322: aload_3
          //   323: astore_2
          //   324: goto -45 -> 279
          //   327: astore 10
          //   329: aload 10
          //   331: astore 11
          //   333: aload_3
          //   334: astore_2
          //   335: goto -113 -> 222
          //   338: astore 4
          //   340: aload 4
          //   342: astore 5
          //   344: aload_3
          //   345: astore_2
          //   346: goto -195 -> 151
          //
          // Exception table:
          //   from	to	target	type
          //   0	32	43	org/jivesoftware/smack/XMPPException
          //   73	85	145	java/io/FileNotFoundException
          //   184	208	211	java/io/IOException
          //   73	85	216	org/jivesoftware/smack/XMPPException
          //   245	269	272	java/io/IOException
          //   73	85	277	finally
          //   151	180	277	finally
          //   222	241	277	finally
          //   104	128	310	java/io/IOException
          //   283	307	315	java/io/IOException
          //   85	100	320	finally
          //   85	100	327	org/jivesoftware/smack/XMPPException
          //   85	100	338	java/io/FileNotFoundException
        }
      }
      , "File Transfer " + this.streamID);
      this.transferThread.start();
      monitorexit;
    }
  }

  /**
   * @deprecated
   */
  public void sendFile(String paramString1, long paramLong, String paramString2, NegotiationProgress paramNegotiationProgress)
  {
    monitorenter;
    if (paramNegotiationProgress == null);
    try
    {
      throw new IllegalArgumentException("Callback progress cannot be null.");
    }
    finally
    {
      monitorexit;
      throw localObject;
      checkTransferThread();
      if ((isDone()) || (this.outputStream != null))
        throw new IllegalStateException("The negotation process has already been attempted for this file transfer");
      this.callback = paramNegotiationProgress;
      this.transferThread = new Thread(new Runnable(this, paramString1, paramLong, paramString2, paramNegotiationProgress)
      {
        public void run()
        {
          try
          {
            OutgoingFileTransfer.access$1(this.this$0, OutgoingFileTransfer.access$0(this.this$0, this.val$fileName, this.val$fileSize, this.val$description));
            this.val$progress.outputStreamEstablished(OutgoingFileTransfer.access$2(this.this$0));
            return;
          }
          catch (XMPPException localXMPPException)
          {
            OutgoingFileTransfer.access$3(this.this$0, localXMPPException);
          }
        }
      }
      , "File Transfer Negotiation " + this.streamID);
      this.transferThread.start();
      monitorexit;
    }
  }

  /**
   * @deprecated
   */
  public void sendStream(InputStream paramInputStream, String paramString1, long paramLong, String paramString2)
  {
    monitorenter;
    try
    {
      checkTransferThread();
      this.transferThread = new Thread(new Runnable(this, paramString1, paramLong, paramString2, paramInputStream)
      {
        // ERROR //
        public void run()
        {
          // Byte code:
          //   0: aload_0
          //   1: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   4: aload_0
          //   5: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   8: aload_0
          //   9: getfield 26	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:val$fileName	Ljava/lang/String;
          //   12: aload_0
          //   13: getfield 28	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:val$fileSize	J
          //   16: aload_0
          //   17: getfield 30	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:val$description	Ljava/lang/String;
          //   20: invokestatic 44	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$0	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;Ljava/lang/String;JLjava/lang/String;)Ljava/io/OutputStream;
          //   23: invokestatic 48	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$1	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;Ljava/io/OutputStream;)V
          //   26: aload_0
          //   27: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   30: invokestatic 52	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   33: ifnonnull +16 -> 49
          //   36: return
          //   37: astore_1
          //   38: aload_0
          //   39: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   42: aload_1
          //   43: invokestatic 56	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$3	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;Lorg/jivesoftware/smack/XMPPException;)V
          //   46: goto -10 -> 36
          //   49: aload_0
          //   50: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   53: getstatic 62	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:negotiated	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   56: getstatic 65	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:in_progress	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   59: invokevirtual 69	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:updateStatus	(Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;)Z
          //   62: ifeq -26 -> 36
          //   65: aload_0
          //   66: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   69: aload_0
          //   70: getfield 32	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:val$in	Ljava/io/InputStream;
          //   73: aload_0
          //   74: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   77: invokestatic 52	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   80: invokevirtual 73	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:writeToStream	(Ljava/io/InputStream;Ljava/io/OutputStream;)V
          //   83: aload_0
          //   84: getfield 32	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:val$in	Ljava/io/InputStream;
          //   87: ifnull +10 -> 97
          //   90: aload_0
          //   91: getfield 32	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:val$in	Ljava/io/InputStream;
          //   94: invokevirtual 78	java/io/InputStream:close	()V
          //   97: aload_0
          //   98: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   101: invokestatic 52	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   104: invokevirtual 83	java/io/OutputStream:flush	()V
          //   107: aload_0
          //   108: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   111: invokestatic 52	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   114: invokevirtual 84	java/io/OutputStream:close	()V
          //   117: aload_0
          //   118: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   121: getstatic 65	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:in_progress	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   124: getstatic 87	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:complete	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   127: invokevirtual 69	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:updateStatus	(Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;)Z
          //   130: pop
          //   131: goto -95 -> 36
          //   134: astore 4
          //   136: aload_0
          //   137: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   140: getstatic 90	org/jivesoftware/smackx/filetransfer/FileTransfer$Status:error	Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;
          //   143: invokevirtual 94	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:setStatus	(Lorg/jivesoftware/smackx/filetransfer/FileTransfer$Status;)V
          //   146: aload_0
          //   147: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   150: aload 4
          //   152: invokevirtual 98	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:setException	(Ljava/lang/Exception;)V
          //   155: aload_0
          //   156: getfield 32	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:val$in	Ljava/io/InputStream;
          //   159: ifnull +10 -> 169
          //   162: aload_0
          //   163: getfield 32	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:val$in	Ljava/io/InputStream;
          //   166: invokevirtual 78	java/io/InputStream:close	()V
          //   169: aload_0
          //   170: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   173: invokestatic 52	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   176: invokevirtual 83	java/io/OutputStream:flush	()V
          //   179: aload_0
          //   180: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   183: invokestatic 52	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   186: invokevirtual 84	java/io/OutputStream:close	()V
          //   189: goto -72 -> 117
          //   192: astore 5
          //   194: goto -77 -> 117
          //   197: astore_2
          //   198: aload_0
          //   199: getfield 32	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:val$in	Ljava/io/InputStream;
          //   202: ifnull +10 -> 212
          //   205: aload_0
          //   206: getfield 32	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:val$in	Ljava/io/InputStream;
          //   209: invokevirtual 78	java/io/InputStream:close	()V
          //   212: aload_0
          //   213: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   216: invokestatic 52	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   219: invokevirtual 83	java/io/OutputStream:flush	()V
          //   222: aload_0
          //   223: getfield 24	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer$3:this$0	Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;
          //   226: invokestatic 52	org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer:access$2	(Lorg/jivesoftware/smackx/filetransfer/OutgoingFileTransfer;)Ljava/io/OutputStream;
          //   229: invokevirtual 84	java/io/OutputStream:close	()V
          //   232: aload_2
          //   233: athrow
          //   234: astore 7
          //   236: goto -119 -> 117
          //   239: astore_3
          //   240: goto -8 -> 232
          //
          // Exception table:
          //   from	to	target	type
          //   0	26	37	org/jivesoftware/smack/XMPPException
          //   65	83	134	org/jivesoftware/smack/XMPPException
          //   155	189	192	java/io/IOException
          //   65	83	197	finally
          //   136	155	197	finally
          //   83	117	234	java/io/IOException
          //   198	232	239	java/io/IOException
        }
      }
      , "File Transfer " + this.streamID);
      this.transferThread.start();
      monitorexit;
      return;
    }
    finally
    {
      localObject = finally;
      monitorexit;
      throw localObject;
    }
  }

  protected void setException(Exception paramException)
  {
    super.setException(paramException);
    if (this.callback != null)
      this.callback.errorEstablishingStream(paramException);
  }

  protected void setOutputStream(OutputStream paramOutputStream)
  {
    if (this.outputStream == null)
      this.outputStream = paramOutputStream;
  }

  protected void setStatus(FileTransfer.Status paramStatus)
  {
    FileTransfer.Status localStatus = getStatus();
    super.setStatus(paramStatus);
    if (this.callback != null)
      this.callback.statusUpdated(localStatus, paramStatus);
  }

  protected boolean updateStatus(FileTransfer.Status paramStatus1, FileTransfer.Status paramStatus2)
  {
    boolean bool = super.updateStatus(paramStatus1, paramStatus2);
    if ((this.callback != null) && (bool))
      this.callback.statusUpdated(paramStatus1, paramStatus2);
    return bool;
  }

  public static abstract interface NegotiationProgress
  {
    public abstract void errorEstablishingStream(Exception paramException);

    public abstract void outputStreamEstablished(OutputStream paramOutputStream);

    public abstract void statusUpdated(FileTransfer.Status paramStatus1, FileTransfer.Status paramStatus2);
  }
}